// const lightCodeTheme = require('prism-react-renderer/themes/github');
// const darkCodeTheme = require('prism-react-renderer/themes/dracula');

module.exports = {
  // 站点元数据
  title: '笔墨纸砚',
  // 网站首页标语
  // tagline: '读书是为了好好工作，工作是为了读更多的书，因为读书会让你变得富有和满足',
  tagline: "依心而为，无悔今生；不忘初心，方得始终；",
  url: 'https://algate.gitee.io',
  baseUrl: '/',
  onBrokenLinks: 'throw',
  onBrokenMarkdownLinks: 'warn',
  favicon: 'img/favicon.ico',
  // deploy命令部署站点
  organizationName: 'facebook', // Usually your GitHub org/user name.
  projectName: 'docusaurus', // Usually your repo name.

  // Even if you don't use internalization, you can use this field to set useful
  // metadata like html lang. For example, if your site is Chinese, you may want
  // to replace "en" with "zh-Hans".
  /* i18n: {
    defaultLocale: 'en',
    locales: ['en'],
  }, */
  /* 
   * 主题、插件和预设配置
   * List the theme, plugins, and presets for your site in the themes, plugins, and presets fields, respectively.
   * 如果加载本地主题：
   * const path = require('path');
      module.exports = {
      // ...
      themes: [path.resolve(__dirname, '/path/to/docusaurus-local-theme')],
      };
  */
  themeConfig: {
    // Categories always expanded; 要设置单个分类到siderbars.js中单独设置
    // sidebarCollapsible: true,
    // 隐藏侧边栏按钮
    // hideableSidebar: true,
    image: 'img/logo.png',
    // 网站顶部消息
    announcementBar: {
      id: 'support_us', // Any value that will identify this message.
      content:
        '我叫白纸，欢迎关注『笔墨纸砚』！点击右侧 x 可以关闭该消息;点击页面有特效哦O(∩_∩)O哈~',
      backgroundColor: '#fafbfc', // Defaults to `#fff`.
      textColor: '#2dabff', // Defaults to `#000`.
      isCloseable: true, // Defaults to `true`.
    },
    colorMode: {
      defaultMode: 'light',
      disableSwitch: false,
      respectPrefersColorScheme: true
      /* switchConfig: {
        darkIcon: '🌙',
        // lightIcon: '\u2600',
        lightIcon: '🌞',
        // React inline style object
        // see https://reactjs.org/docs/dom-elements.html#style
        darkIconStyle: {
          marginLeft: '2px',
        },
        lightIconStyle: {
          marginLeft: '1px',
        },
      }, */
    },
    /* algolia: {
      apiKey: 'YOUR_API_KEY',
      indexName: 'YOUR_INDEX_NAME',
      // Optional: see doc section bellow
      contextualSearch: true
    }, */
    navbar: {
      title: '笔墨纸砚',
      logo: {
        alt: '笔墨纸砚 - Logo',
        src: 'img/logo.png',
        srcDark: 'img/logo_dark.png', // Default to `logo.src`.
        // href: 'https://algate.gitee.io', // Default to `siteConfig.baseUrl`.
        target: '_self',
      },
      // automatically hides the navbar
      hideOnScroll: true,
      // style: 'primary',
      items: [
        {
          type: 'doc',
          docId: 'javascript/ES6',
          // 该路径开始的路由，通常是不需要的
          activeBasePath: 'docs',
          label: '文章',
          position: 'left',
        },
        {
          to: 'senior',
          activeBasePath: 'senior',
          label: '进阶',
          position: 'left',
        },
        {
          to: 'core',
          activeBasePath: 'core',
          label: '核心',
          position: 'left',
        },
        {
          to: 'frame',
          activeBasePath: 'frame',
          label: '框架',
          position: 'left',
        },
        {
          to: 'Q&A',
          label: 'Q&A',
          activeBasePath: 'Q&A',
          position: 'left',
        },
        {
          type: 'dropdown',
          label: 'BLOG',
          // activeBasePath: 'blog',
          position: 'right',
          items: [
            {
              // type: 'link',
              label: '白纸驿站-v2.0', // The label that should be displayed (string).
              href: 'https://algate.github.io', // The target URL (string).
            },
            {
              // type: 'link',
              label: '白纸驿站-v1.0', // The label that should be displayed (string).
              href: 'https://algate.github.io/hexo.pure/', // The target URL (string).
            }
          ]
        },
        {
          to: 'blog',
          label: '博客',
          activeBasePath: 'blog',
          position: 'right',
        },
        {
          to: 'money',
          label: '钱·快来',
          activeBasePath: 'money',
          position: 'right'
        },
        {
          href: 'https://algate.github.io/HammerUI/',
          label: '🔨UI',
          position: 'right',
          className: 'header-hammer-link',
        },
        {
          href: 'https://algate.github.io/Lottery/',
          label: '⚽彩',
          position: 'right',
          className: 'header-lottery-link',
        },
        {
          href: 'https://github.com/algate',
          // label: 'Github',
          position: 'right',
          className: 'header-github-link',
        },
      ],
    },
    footer: {
      style: 'dark',
      links: [
        {
          title: 'Docs',
          items: [
            {
              label: 'syntax',
              to: 'docs/',
            },
            {
              label: 'senior',
              to: 'senior/',
            },
            {
              label: 'core',
              to: 'core/',
            },
          ],
        },
        {
          title: 'Blog',
          items: [
            {
              label: 'Blog',
              to: 'blog',
            },
            {
              label: 'money',
              to: 'money',
            }
          ],
        },
        {
          title: 'More',
          items: [
            {
              label: '白纸驿站-2.0',
              to: 'https://algate.github.io',
            },
            {
              label: '白纸驿站-1.0',
              to: 'https://algate.github.io/hexo.pure/',
            },
            {
              label: '🔨UI-H5',
              to: 'https://algate.github.io/HammerUI/'
            },
            {
              label: '⚽测-H5',
              to: 'https://algate.github.io/Lottery/'
            },
          ],
        },
        {
          title: 'extends',
          items: [
            {
              label: '公众号：我叫白纸',
              to: '/',
            },
          ],
        },
      ],
      copyright: `Copyright © ${new Date().getFullYear()} 笔墨纸砚@白纸 , Inc. Built with Docusaurus.`,
    },
    /*
    // 此处要用需要安装插件 - 看管网 
    prism: {
        additionalLanguages: ['powershell'],
    }, */
    /* prism: {
      theme: lightCodeTheme,
      darkTheme: darkCodeTheme,
    }, */
  },
  presets: [
    [
      // '@docusaurus/preset-classic',
      'classic',
      {
        docs: {
          path: 'docs',
          routeBasePath: 'docs',
          sidebarPath: require.resolve('./sidebars/sidebars.js'),
          // Please change this to your repo.
          // editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
          /**
           * Whether to display the author who last updated the doc.
           */
          showLastUpdateAuthor: false,
          /**
           * Whether to display the last date the doc was updated.
           */
          showLastUpdateTime: false,
        },
        blog: {
          showReadingTime: true,
          // Please change this to your repo.
          // editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/blog/',
          path: 'blog',
          /**
           * URL route for the blog section of your site.
           * *DO NOT* include a trailing slash.
           */
          routeBasePath: 'blog',
          blogTitle: '白纸的 blog!',
          blogDescription: 'A docusaurus powered blog!',
          /**
           * Blog page title for better SEO
           */
          blogTitle: '好好读书',
          /**
           * Blog page meta description for better SEO
           */
          blogDescription: 'Blog',
          /**
           * Number of blog post elements to show in the blog sidebar
           * 'ALL' to show all blog posts
           * 0 to disable
           */
          // blogSidebarCount: 5,
          /**
           * Title of the blog sidebar
           */
          blogSidebarTitle: '读书笔记',
          include: ['*.md', '*.mdx'],
          postsPerPage: 2,
          /**
           * Theme components used by the blog pages.
           */
          blogListComponent: '@theme/BlogListPage',
          blogPostComponent: '@theme/BlogPostPage',
          blogTagsListComponent: '@theme/BlogTagsListPage',
          blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
          /**
           * Remark and Rehype plugins passed to MDX.
           */
          remarkPlugins: [
            /* require('remark-math') */
          ],
          rehypePlugins: [],
          /**
           * Custom Remark and Rehype plugins passed to MDX before
           * the default Docusaurus Remark and Rehype plugins.
           */
          beforeDefaultRemarkPlugins: [],
          beforeDefaultRehypePlugins: [],
          /**
           * Truncate marker, can be a regex or string.
           */
          truncateMarker: /<!--\s*(truncate)\s*-->/,
          /**
           * Show estimated reading time for the blog post.
           */
          showReadingTime: true,
          /**
           * Blog feed.
           * If feedOptions is undefined, no rss feed will be generated.
           */
          feedOptions: {
            type: 'all', // required. 'rss' | 'feed' | 'all'
            title: '', // default to siteConfig.title
            description: '', // default to  `${siteConfig.title} Blog`
            copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`,
            language: undefined, // possible values: http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
          },
        },
        theme: {
          customCss: require.resolve('./src/css/custom.css'),
        },
      },
    ],
    [
      '@docusaurus/plugin-sitemap',
      {
        cacheTime: 600 * 1000, // 600 sec - cache purge period
        changefreq: 'weekly',
        priority: 0.5,
        trailingSlash: false,
      },
    ],
  ],
  plugins: [
    // Docs Multi-instance
    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'senior',
        path: 'senior',
        routeBasePath: 'senior',
        sidebarPath: require.resolve('./sidebars/seniorSidebars.js'),
        /**
         * Whether to display the author who last updated the doc.
         */
        showLastUpdateAuthor: false,
        /**
         * Whether to display the last date the doc was updated.
         */
        showLastUpdateTime: false,
      },
    ],
    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'core',
        path: 'core',
        routeBasePath: 'core',
        sidebarPath: require.resolve('./sidebars/coreSidebars.js'),
        /**
         * Whether to display the author who last updated the doc.
         */
        showLastUpdateAuthor: false,
        /**
         * Whether to display the last date the doc was updated.
         */
        showLastUpdateTime: false,
      },
    ],
    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'frame',
        path: 'frame',
        routeBasePath: 'frame',
        sidebarPath: require.resolve('./sidebars/frameSidebars.js'),
        /**
         * Whether to display the author who last updated the doc.
         */
        showLastUpdateAuthor: false,
        /**
         * Whether to display the last date the doc was updated.
         */
        showLastUpdateTime: false,
      },
    ],
    // Multiple blogs
    [
      '@docusaurus/plugin-content-blog',
      {
        showReadingTime: true,
        /**
         * Required for any multi-instance plugin
         */
        id: 'QA',
        /**
         * Path to data on filesystem relative to site dir.
         */
        path: 'Q&A',
        /**
         * URL route for the blog section of your site.
         * *DO NOT* include a trailing slash.
         */
        routeBasePath: 'Q&A',
        showReadingTime: true,
        // Please change this to your repo.
        // editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/blog/',
        blogTitle: '白纸的花园!',
        blogDescription: 'A docusaurus powered blog!',
        /**
         * Blog page title for better SEO
         */
        blogTitle: '慢慢欣赏',
        /**
         * Blog page meta description for better SEO
         */
        blogDescription: 'beautiful',
        /**
         * Number of blog post elements to show in the blog sidebar
         * 'ALL' to show all blog posts
         * 0 to disable
         */
        // blogSidebarCount: 5,
        /**
         * Title of the blog sidebar
         */
        blogSidebarTitle: '前端大乱炖',
        include: ['*.md', '*.mdx'],
        postsPerPage: 2,
      },
    ],
    // Multiple blogs
    [
      '@docusaurus/plugin-content-blog',
      {
        showReadingTime: true,
        /**
         * Required for any multi-instance plugin
         */
        id: 'money',
        /**
         * Path to data on filesystem relative to site dir.
         */
        path: 'money',
        /**
         * URL route for the blog section of your site.
         * *DO NOT* include a trailing slash.
         */
        routeBasePath: 'money',
        showReadingTime: true,
        // Please change this to your repo.
        // editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/blog/',
        blogTitle: '白纸的花园!',
        blogDescription: 'A docusaurus powered blog!',
        /**
         * Blog page title for better SEO
         */
        blogTitle: '慢慢欣赏',
        /**
         * Blog page meta description for better SEO
         */
        blogDescription: 'beautiful',
        /**
         * Number of blog post elements to show in the blog sidebar
         * 'ALL' to show all blog posts
         * 0 to disable
         */
        // blogSidebarCount: 5,
        /**
         * Title of the blog sidebar
         */
        blogSidebarTitle: '洗涤心灵',
        include: ['*.md', '*.mdx'],
        postsPerPage: 2,
      },
    ],
  ],
  // 添加 script 如下：
  scripts: [
    // String format.
    // 'https://docusaurus.io/script.js',
    // './src/js/music.js',
    // Object format.
    /* {
        src:
            'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
        async: true,
    }, */
    {
      src: 'https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js',
      async: true,
    },
    {
      // version1.2 和 version 2.0 使用方法有所不同 - 看官方文档
      // src: 'https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js',
      src: 'https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js',
      async: true,
    },
    {
      src: 'js/click.js',
      defer: true,
    },
    /* {
        src: 'js/xue.js',
        async: true,
    } */
  ],
  // An array of client modules to load globally on your site:
  clientModules: [
    // require.resolve('./src/js/click.js'),
  ],
  // 加载样式：
  stylesheets: [
    // String format.
    // 'https://docusaurus.io/style.css',
    // Object format.
    /* {
        href: 'http://mydomain.com/style.css',
        type: 'text/css',
    }, */
    'https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css',
  ],
  // 替换网站title中的 ‘|’
  titleDelimiter: '📖',
  baseUrlIssueBanner: true
};
